#include<iostream>
#include<string>
#include<signal.h>
#include<unistd.h>
#include<stdio.h>
using namespace std;
void sighandler(int signal);
int main(int argc, char** argv)
{
    signal(SIGINT, sighandler); // register signal handler for SIGINT (Ctrl+C)
    signal(SIGQUIT, sighandler);
    // printf("hello world\n");
    pause();
    return 0;
}

void sighandler(int signal)
{
    printf("received a signal:%d\n", signal);
    // do some cleanup work here
    return;
}